banklist=[
	{"username":"admin01","money":"10000"},
	{"username":"admin02","money":"20000"},
	{"username":"admin03","money":"30000"}]
def showbank(banklist):
#银行信息输入函数
	if len(banklist)==0:
		print("="*10,"无任何信息可以输出","="*10)
		return
	print("|{0:<5}|{1:<10}|{2:<5}|".format("sid","username","money"))
	print("-"*30)
	for i in range(len(banklist)):
		print("|{0:<5}| {1:<10}| {2:<5}| ".format(i+1,banklist[i]["username"],banklist[i]["money"]))
print("="*12,"银行信息系统","="*12)
print("a.登录","     ","b.退出")
print("="*40)

key=input("请输入对应的选项：")
if key=="a":
	print("-"*40)
	print("="*10,"欢迎登录银行系统","="*10)
	print("-"*40)

	while True:
		print("="*10,"银行管理系统","="*10)
		print("1.查询余额","      ","2.存钱业务")
		print("3.取钱业务","      ","4.退出系统")
		key=input("请输入对应的选项:")
		#根据输入值判断并执行相应的操作
		if key == "1":
			print("="*10,"查询余额","="*10)
			showbank(banklist)
			input("按回车键继续：")

		elif key=="2":
			print("="*10,"存钱业务","="*10)
			
			bank={}
			bank["username"]=input("请输入对应的用户名:")
			bank["money"]=input("请输入对应的存款金额:")
			num=""
			#判断输入的金额是否为数字，如果输入金额是数字，插入输入的信息，并展开列表
			if bank["money"].isdigit():
				print(num)
				banklist.append(bank)
				showbank(banklist)
				#如果输入的不是数字，请重新输入
			else:
				print("存款金额非数字，请重新输入:")
				bank["banklist"]=input("请输入存款金额:")
				banklist.append(bank)
				showbank(banklist)
				input("按回车键继续：")
		elif key=="3":
			print("="*10,"取钱业务","="*10)
			
			showbank(banklist)
			sid=int(input("请输入序列号:"))
			del banklist[int(sid)-1]
			showbank(banklist)
			input("按回车键继续:")

		elif key=="4":
			print("="*10,"退出系统","="*10)
			
			break

		else:
			print("="*12,"无效输入","="*12)
		


